function initAElement(key,target){
	mui('body').on('tap',key,function(){
		mui.openWindow(target);
	})
}

initAElement('#m3a1','m301.html');
initAElement('#m3a2','m302.html');
initAElement('#m3a3','m303.html');

mui('body').on('tap','#m3a7',function(){
	mui.confirm('请问真的要注销用户信息吗？','提示：',new Array('否','是'),function(e){
		if(e.index==1) {
			localStorage.removeItem('uid');
			ID("m3li1").innerHTML="";
			ID("m3li1").appendChild(logRegInit());
			ID("m3a7").style.display = "none";
			mui.toast("您已注销登陆您的登陆信息");
		}
	});
})

function m3Init()
{
	var uid = localStorage.getItem("uid");
	if(uid!=null&&uid!='')
	{
		duid = { 'uid' : uid };
		mui.ajax({
			url	:ASYURI + 'M3.do',
			type:'POST',
			data:duid,
			success:function(data)
			{
				var obj = eval('('+data+')');
				ID("m3li1").innerHTML = "用户:"+obj.appellat;
				ID("m3a7").style.display = "inline";
			},
			error  :function(xhr,type,errorThrown)
			{
				console.log(xhr+":"+type+"-"+errorThrown);
			}
		});
	}
	else
	{
		document.getElementById("m3a7").style.display = "none";
	}
}


function logRegInit()
{
	var alogReg = document.createElement("a");
	alogReg.setAttribute("class","mui-navigate-right");
	alogReg.setAttribute("id","m3a1");
	alogReg.innerHTML = '登陆/注册';
	return alogReg;
}
function ID(id)
{
	return document.getElementById(id);
}

function m3test()
{
	m3Init();
}

m3Init();